"""CreateServicesScopeTable Migration."""

from masoniteorm.migrations import Migration


class CreateServicesScopeTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with create("services_scopes") as table:
            table.increments("id")
            table.string('name_ch').comment('套餐名称')
            table.string('name_ug').comment('套餐名称')
            # table.enum('type',['number','square']).comment('number=次数｜｜square=平方')
            # table.integer('count').default(1).comment('次数')
            table.decimal('price',10, 2).comment('1平方 单价')
            table.decimal('min_square',10, 2).comment('最低平方')
            table.integer('sid').unsigned().comment('服务ID')
            table.foreign('sid').references('id').on('services')
            table.tiny_integer('is_delete').default(0).comment('是否删除')
            table.timestamps()
    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("services_scopes")
